题目: You are given an integer array nums and you have to return a new counts array. The counts array ...
题目: You are given an integer array nums and you have to return a new counts array. The counts array ...
分治法基础 分治法(Divide and Conquer)顾名思义,思想核心是将问题拆分为子问题,对子问题求解、最终合并结果,分治法用伪代码表示如下: 分治法简单而言分三步 D ...
看起来很难,但是仔细想一下,实质就是二叉树的中序遍历的问题,中序遍历有递归和非递归(至少两种写法)。 递归: 非递归 Divide a ...
题目: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), incl ...
原题链接在这里:https://leetcode.com/problems/k-closest-points-to-origin/ 题目: We have a list of points on ...
(This problem is an interactive problem.) On the sea represented by a cartesian plane, each ship is ...
https://leetcode.com/problems/reverse-pairs/#/description 和315, 327是一类题。 分治法,合并的过程就是归并排序,在归并的过程中,对 ...